/*
 * BPlusTreeFileHandler_gtest.h
 *
 *  Created on: Nov 27, 2012
 *      Author: m
 */

#include <string>
#include <gtest/gtest.h>

//#include "../logic_layer/bplustree/bplusfilehandler/BPlusTreeFile.h"
#include "../logic_layer/bplustree/BPlusTreeFixed.h"

/**
 * Test Suite de la clase SBPlusTreeFileHandler
 */

class BPlusTreeFileHandlerTestFixture: public ::testing::Test
{
public:

    BPlusTreeFileHandlerTestFixture()
    {
        /*
         * Acá lo único que hago es obtener el nombre
         * del TestFixture y del TestCase que se está ejecutando
         * y con eso armo un "filename" del tipo: testname.testcase.tmp
         */

        const ::testing::TestInfo* const test_info =
                ::testing::UnitTest::GetInstance()->current_test_info();

        std::string filename( test_info->name() );
        filename.append( "." );
        filename.append( test_info->test_case_name() );
        filename.append( ".tmp" );

        m_filename = filename;
    }

    virtual ~BPlusTreeFileHandlerTestFixture()
    {
    }

    void SetUp()
    {
    }

    void TearDown()
    {
    }

    /**
     * Devuelve un filename como: testname.testcase.tmp
     *
     * @return un filename predecible para usar en el test
     */
    const char* getFileNameForTest()
    {
        return m_filename.c_str();
    }

    std::string m_filename;
};

/**
 * Test begin
 */
TEST_F( BPlusTreeFileHandlerTestFixture, begin)
{
	//BPlusTreeFile handler( this->getFileNameForTest(), 8 * 64, true );

	//BPlusTreeFixed tree( this->getFileNameForTest(), 8 * 64, true );

    //ASSERT_TRUE( handler.begin() == 0 );
}
